package com.glsc.ngateway.common.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 流程状态
 *
 * @author xuchang
 */
@Getter
@AllArgsConstructor
public enum OaFlowSyncLogStatusEnum {
    /**
     * 未同步
     */
    UNSYNC("UNSYNC", "未同步"),
    /**
     * 已同步
     */
    SYNCED("SYNCED", "已同步"),
    /**
     * 已结束（被驳回或审批）
     */
    END_GATEWAY("END_GATEWAY", "已结束"),
    /**
     * 已结束（被驳回或审批）
     */
    END_OA("END_OA", "已结束"),
    /**
     * 取消
     */
    CANCELLED("CANCELLED", "已取消"),
    ;
    /**
     * 编码
     */
    private final String code;
    /**
     * 描述
     */
    private final String desc;

    public static boolean canSync(String code) {
        return OaFlowSyncLogStatusEnum.UNSYNC.getCode().equals(code);
    }

    public static boolean isEnd(String code) {
        return OaFlowSyncLogStatusEnum.END_GATEWAY.getCode().equals(code) || OaFlowSyncLogStatusEnum.END_OA.getCode().equals(code);
    }
}
